from selenium import webdriver
from time import sleep
from selenium.webdriver.common.by import By
from chromeDriver import driver

driver.get("http://127.0.0.1/upload/index.php")
# 输入关键字a
driver.find_element(By.XPATH,"//input[@id='keyword']").send_keys("a")
# 点击搜索
driver.find_element(By.XPATH,"//input[@name='imageField']").click()
sleep(2)
# 点击P806商品的图片
driver.find_element(By.XPATH,"//img[@alt='P806']").click()
sleep(2)
# 点击“加入购物车”
driver.find_element(By.XPATH,"//form[@id='ECS_FORMBUY']/ul/li[9]/a[1]/img").click()
sleep(3)
# 点击商标
driver.find_element(By.XPATH,"//a[@name]/img").click()
# 点击高级搜索
driver.find_element(By.XPATH,"//form[select]/a").click()
# 输入关键字a
driver.find_element(By.XPATH,"//form[a='高级搜索']/input[1]").send_keys("a")
sleep(2)
driver.quit()